{% extends 'base.html' %}
{% block content %}
    <div class="alert alert-success" role="alert">管理认证成功</div>
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title">成员管理</h3>
        </div>



        <div class="panel-body">
            <!--数据表开始-->
            <div class="row">

                <div class="col-lg-4">
                    <div class="input-group ">
                        <input type="text" class="form-control" placeholder="Search for...">
                        <span class="input-group-btn">
                                <button class="btn btn-default" type="button">Go!</button>
                            </span>
                    </div><!-- /input-group -->
                </div>


            </div>
            <hr>
            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>学号</th>
                        <th>专业</th>
                        <th>姓名</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for member in member_list %}
                        <tr>
                            <td>{{ member.studentNum }}</td>
                            <td>{{ member.cid }}</td>
                            <td>{{ member.username }}</td>
                            <td>
                                <span class="hidden">{{ major.id }}</span>
                                <a href="/edit_member?edit_sno={{ member.studentNum }}" class="btn btn-info"  id="edit_btn">编辑</a>
                                <a href="/delete_member?delete_sno={{ member.studentNum }}" class="btn btn-danger">
                                    删除
                                </a>
                            </td>
                        </tr>

                    {% endfor %}

                    </tbody>
                </table>
            </div>

            <script>
                $('table').on('click', '#edit_btn', function () {
                    $('#edit_modal #edit_major_id_input').val($(this).prev().text())
                    $('#edit_modal #major_input').val($(this).parent().prev().text())
                })

            </script>
            <!--面板底部开始-->
            <div class="panel-footer">
                <!--分页-->
                <nav aria-label="Page navigation">
                    <ul class="pagination pull-right">
                        <li>
                            <a href="#" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                        <li><a href="#">1</a></li>
                        <li><a href="#">2</a></li>
                        <li><a href="#">3</a></li>
                        <li><a href="#">4</a></li>
                        <li><a href="#">5</a></li>
                        <li>
                            <a href="#" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
        </div>
    </div>



{% endblock content %}

{% block sidebar %}
    8
{% endblock sidebar %}